﻿@model SIFIET.Models.ItemSurvey
@using System.Collections.Specialized

@{
    ViewBag.Title = "Crear Item desde encuesta";
}


<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

<script type="text/javascript">
    $(function () {
        $.getJSON("@Url.Action("SurveysList","ItemSurveys")", null, function (data) {
            var items = "<option></option>";
            $.each(data, function (i, item) {
                items += "<option value=" + i + ">" + item + "</option>";
            });

            $("#C2").html(items);
        });

        $("#C2").change(function () {
            var Param = { ids: $("#C2 > option:selected").attr("value") };
            $.getJSON("@Url.Action("TopicsList","ItemSurveys")", Param, function (data) {
                var items = "<option></option>";
                $.each(data, function (i, item) {
                    items += "<option value=" + i + ">" + item + "</option>";
                });
                $("#C3").html(items);
            });
        });

        $("#C3").change(function () {
            var Param = { idt: $("#C3 > option:selected").attr("value") };
            $.getJSON("@Url.Action("QuestionsList","ItemSurveys")", Param, function (data) {
                var items = "<option></option>";
                $.each(data, function (i, item) {
                    items += "<option value=" + i + ">" + item + "</option>";
                });
                $("#C4").html(items);
            });
        });
    });
</script>

<div class="grid">

    <div class="c12">

        <h2>Creacion de Item desde encuesta</h2>

    </div>
   <div>
       
        
    </div>
    <div class="c12">
    
        <div class="c9 first" id=”contenido”>
        <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
            <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
            @using (Html.BeginForm())
            {
                @Html.ValidationSummary(true)
                 <fieldset>
                 <div class="c1 first">
                        <p> </p>
                    </div>
                <div class="c12">
                   
                       <h3> Encuesta</h3>
                    
                    <div class="c11">
                        @Html.DropDownList("IdSurvey", new SelectList(new ListDictionary()), htmlAttributes: new { @class = "classsurveys", @id = "C2" })                      
                        <div class="alert error">                   
                        
                         @Html.ValidationMessageFor(model => model.IdSurvey)
                        </div>
                       
                    </div>
                </div>
                <div class="c12">
                  
                       <h3> Tema</h3>
                    
                    <div class="c11">
                        @Html.DropDownList("IdTopic", new SelectList(new ListDictionary()), htmlAttributes: new { @class = "classsurveys", @id = "C3" })  
                         <div class="alert error">            
                         @Html.ValidationMessageFor(model => model.IdTopic)
                          </div>
                    </div>
                </div>
                <div class="c12">
                    
                       <h3>Pregunta</h3>
                    
                     <div class="editor-field">
                        @Html.DropDownList("Question", new SelectList(new ListDictionary()), htmlAttributes: new { @class = "classsurveys", @id = "C4" })                           
                        <div class="alert error">                   
                        
                        @Html.ValidationMessageFor(model => model.Question)
                        </div>
                    </div>
                </div>
                <h3>Tipo de grafico</h3>
                <div class="c12">
                    <div class="c1 first">
                        
                    </div>
                    <div class="c11">
                        <div class="c12">
                            @Html.RadioButton("GraphicType", "Pastel") Pastel

                        </div>
                        <div class="c12">
                            @Html.RadioButton("GraphicType", "Barras") Barras
                        </div>
                           @Html.ValidationMessageFor(model => model.GraphicType)
                    </div>
                    <h3>Opciones</h3>
                    <div class="c12">
                        <div class="c3">
                            <p style="font-size: 13px">Numero de Pagina</p>
                        </div>
                       <div class="editor-field">
                            @Html.TextBox("ItemNumber", "")
                            <div >                   
                        
                                @Html.ValidationMessageFor(model => model.ItemNumber)
                        </div>
                        </div>
                    </div> 
                    <br/>                
                </div>
               <br/>
               <br/>
                

        <p> <br/> <br/> <br/> <br/>
                <input type="submit" value="Guardar" class="ebutton2 blue" />&nbsp;@Html.ActionLink("Regresar al listado", "../Items/GeneralItems", routeValues: new { id = @TempData["idr"] }, htmlAttributes: new { @class = "ebutton blue" })
                 </p>
                
                </fieldset>               
            }
        </div>

       <div class="c3 last" id=”layout”>@Html.Partial("_LayoutSideBar")</div>

    </div>

    &nbsp;
</div>
